import axios from 'axios'

const $http = axios.create({
	baseURL:'http://www.wkserver.top:8080',
	timeout:50000,
})

// 拦截器
//请求拦截
$http.interceptors.request.use(function (config) {
	config.headers = JSON.parse(window.sessionStorage.getItem("access-admin"))
	return config;
  }, function (error) {
    return Promise.reject(error);
  });

//响应拦截
$http.interceptors.response.use(function (response) {
    return response;
  }, function (error) {
    return Promise.reject(error);
  });
  
export default $http